import random

class Player:

    def hunt_choices(
                    self,
                    round_number,
                    current_food,
                    myr,
                    m,
                    player_reputations,
                    ):
        choices = []
        for r in player_reputations:
            ghh = (r * 6 + myr * 6)/2 - 6 * myr        # he hunts,  I hunt
            gsh = ((1 - r) * 0 + myr * 6)/2  - 6 * myr # he slacks, I hunt
            
            gss = ((1 - r) * 0  + (1 - myr)*0)/2 - 2 * myr # he slacks, I slack
            ghs = (r * 6 + (1 - myr)*0)/2 - 2 * myr        # he hunts, I slack

            maxim = max([ghh, gsh, gss, ghs]) # compute max gain -> to slack or not to slack
            sums = sum([ghh, gsh, gss, ghs])
            if sums == 0: # in the first rounds, this will be 0 and it doesn't really matter, so behave randomly
                choices.append('h' if random.random() > 0.5 else 's') 
            elif maxim == ghh or maxim == gsh: # I should hunt
                if r >= (1 - r):# Let him hunt since he is more probable to hunt either way
                    choices.append('s')
                else:
                    if current_food <= 6 : # Can't afford to hunt, starving :(
                        choices.append('s')
                    else :
                        choices.append('h') # If I really have to, let's hunt!
            else:# It's more convenient to slack, since I'd loose more by hunting, reputation aside
                choices.append('s')
        return choices

    def hunt_outcomes(self, food_earnings):
        pass # do nothing

    def round_end(self, award, m, number_hunters):
        pass # do nothing
